#include <iostream>
#include <mutex>
#include <memory>

using namespace std;

class some_resource{
public:
    void reset(some_resource *){}
    void do_something(){}
};

//normally init singal thread source
shared_ptr<some_resource> resource_ptr;
void foo()
{
    if(!resource_ptr)
    {
        resource_ptr.reset(new some_resource);
    }
    resource_ptr->do_something();
}




int main()
{
    std::cout << "Hello world" << std::endl;
    return 0;
}

